package com.ruoyi.labour.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.labour.domain.vo.PageVo;
import com.ruoyi.labour.service.BusinessLicenseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/BusinessLicense")
@Api(tags = "上传营业执照")
public class BusinessLicenseController {

    @Autowired
    private BusinessLicenseService businessLicenseService;

    /**
     * 修改营业执照状态
     * @param status
     * @param id
     * @return
     */
    @ApiOperation("修改营业执照状态")
    @PostMapping("/BusinessLicense/{status}/{id}")
    public R updateBusiness(@PathVariable("status") Integer status,
                            @PathVariable("id") Integer id){
        return businessLicenseService.updateBusiness(status,id);
    }

    /**
     * 查询营业执照
     * @param pageVo
     * @return
     */
    @ApiOperation("查询营业执照")
    @PostMapping("/BusinessStatus")
    public R selectBusinessStatus(@RequestBody PageVo pageVo){
        return businessLicenseService.selectBusinessStatus(pageVo);
    }

    /**
     * 根据id查询营业执照
     * @param id
     * @return
     */
    @ApiOperation("根据id查询营业执照")
    @PostMapping("/selectBusiness/{id}")
    public R selectBusiness(@PathVariable Integer id){
        return businessLicenseService.selectBusiness(id);
    }
}
